package cn.bdqn.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import cn.bdqn.dao.AnswerMapper;
import cn.bdqn.dao.QuestionMapper;
import cn.bdqn.pojo.Answer;
import cn.bdqn.pojo.Question;
import cn.bdqn.service.QuestionService;
@Service("questionService")
public class QuestionServiceImpl implements QuestionService{
	
	@Resource(name="questionMapper")
	private QuestionMapper qMapper;
	
	@Resource(name="answerMapper")
	private AnswerMapper ansMapper;
	
	public List<Question> qlist() {
		// TODO Auto-generated method stub
		return qMapper.qlist();
	}

	@Override
	public int addQus(Question question) {
		// TODO Auto-generated method stub
		return qMapper.addQus(question);
	}

	@Override
	public Question getQue(Question question) {
		// TODO Auto-generated method stub
		Question ques=qMapper.getQue(question);
		List<Answer> anList=ansMapper.anList(question.getId());
		ques.setAnsList(anList);
		return ques;
	}

	@Override
	public int modifyAns(Question question) {
		
		return qMapper.modifyAns(question);
	}

}
